"""
cdn.views.sync

Views exposing the sync functions in cdn.sync

NOTE: These views should be simple wrappers, because the sync functions are accessible programmatically too.
"""
### Start of imports

# This line just better work...
from jackson import debug

# There's debug stuff for the rest
debug.pre_import(__name__)

debug.importing(__name__, 'admin_api from jackson.cdn')
from jackson.cdn import admin_api

debug.importing(__name__, 'HttpResponse from django.http', 2)
from django.http import HttpResponse

debug.importing(__name__, 'ext_json from jackson.extjson as json')
from jackson.extjson import ext_json as json

debug.importing(__name__, 'Server from jackson.chord')
from jackson.chord import Server

debug.importing(__name__, 'utils from jackson.chord as chord_utils')
from jackson.chord import utils as chord_utils

debug.importing(__name__, 'sync from jackson.cdn')
from jackson.cdn import sync

debug.post_import(__name__)

### End of imports

def clean_content_handler(request):
    context = [__name__, 'clean_content()']
    debug.enter(context, None, 3)
    b = sync.clean_content()
    response = HttpResponse(json.dumps({ 'b' : b }))
    debug.leave(context, None, 3)
    return response

def poke_content_handler(request):
    context = [__name__, 'poke_content()']
    debug.enter(context, None, 3)
    b = sync.poke_content()
    response = HttpResponse(json.dumps({ 'b' : b }))
    debug.leave(context, None, 3)
    return response

def collect_content_handler(request):
    context = [__name__, 'collect_content()']
    debug.enter(context, None, 3)
    b = sync.collect_content()
    response = HttpResponse(json.dumps({ 'b' : b }))
    debug.leave(context, None, 3)
    return response